require 'rubygems'
require 'xmpp4r-simple'
require 'xmpp'

def dir(object)
    puts (object.methods - Object.methods).sort
end

begin
    jabber = Jabber::Simple.new("aconbere@gmail.com", "primeros")
rescue Jabber::AuthenticationFailure => e
    puts e
end

roster = jabber.roster

while roster.items.size == 0
    sleep 0.5
end

roster.items.keys.each do |x|
    puts x
    roster.items[x].groups.each do |y|
        puts "\t" << y
    end
end
